<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: General</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__rtc__general__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">General<div class="ingroups"><a class="el" href="group__group__rtc.html">RTC          (Real-Time Clock)</a> &raquo; <a class="el" href="group__group__rtc__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga4c6aca12f876f94707818e7a5dcdbf82"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__general__functions.html#ga4c6aca12f876f94707818e7a5dcdbf82">Cy_RTC_Init</a> (<a class="el" href="structcy__stc__rtc__config__t.html">cy_stc_rtc_config_t</a> const *config)</td></tr>
<tr class="memdesc:ga4c6aca12f876f94707818e7a5dcdbf82"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the RTC driver.  <a href="#ga4c6aca12f876f94707818e7a5dcdbf82">More...</a><br /></td></tr>
<tr class="separator:ga4c6aca12f876f94707818e7a5dcdbf82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga47268d3ac315e0d41b4795362bc444a8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__general__functions.html#ga47268d3ac315e0d41b4795362bc444a8">Cy_RTC_SetDateAndTime</a> (<a class="el" href="structcy__stc__rtc__config__t.html">cy_stc_rtc_config_t</a> const *dateTime)</td></tr>
<tr class="memdesc:ga47268d3ac315e0d41b4795362bc444a8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the time and date values into the RTC_TIME and RTC_DATE registers.  <a href="#ga47268d3ac315e0d41b4795362bc444a8">More...</a><br /></td></tr>
<tr class="separator:ga47268d3ac315e0d41b4795362bc444a8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gace30abad5d40fc768d7c4fc14e84e847"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__general__functions.html#gace30abad5d40fc768d7c4fc14e84e847">Cy_RTC_GetDateAndTime</a> (<a class="el" href="structcy__stc__rtc__config__t.html">cy_stc_rtc_config_t</a> *dateTime)</td></tr>
<tr class="memdesc:gace30abad5d40fc768d7c4fc14e84e847"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the current RTC time and date.  <a href="#gace30abad5d40fc768d7c4fc14e84e847">More...</a><br /></td></tr>
<tr class="separator:gace30abad5d40fc768d7c4fc14e84e847"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2f2ba9ba2a8e6434242134a1c1a55949"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__general__functions.html#ga2f2ba9ba2a8e6434242134a1c1a55949">Cy_RTC_SetDateAndTimeDirect</a> (uint32_t sec, uint32_t min, uint32_t hour, uint32_t date, uint32_t month, uint32_t year)</td></tr>
<tr class="memdesc:ga2f2ba9ba2a8e6434242134a1c1a55949"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the time and date values into the RTC_TIME and RTC_DATE registers using direct time parameters.  <a href="#ga2f2ba9ba2a8e6434242134a1c1a55949">More...</a><br /></td></tr>
<tr class="separator:ga2f2ba9ba2a8e6434242134a1c1a55949"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaf46c9f9e3dd7029a6c18a711d45aa86"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__general__functions.html#gaaf46c9f9e3dd7029a6c18a711d45aa86">Cy_RTC_SetHoursFormat</a> (<a class="el" href="group__group__rtc__enums.html#ga40c0bfe67e6abf9f8807c8653de6a11b">cy_en_rtc_hours_format_t</a> hoursFormat)</td></tr>
<tr class="memdesc:gaaf46c9f9e3dd7029a6c18a711d45aa86"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the 12/24-hour mode.  <a href="#gaaf46c9f9e3dd7029a6c18a711d45aa86">More...</a><br /></td></tr>
<tr class="separator:gaaf46c9f9e3dd7029a6c18a711d45aa86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafd6640533419a469e0803709c2a00aa3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__general__functions.html#gafd6640533419a469e0803709c2a00aa3">Cy_RTC_SelectFrequencyPrescaler</a> (<a class="el" href="group__group__rtc__enums.html#gaa98ef67a70e8f64649634baee4498d56">cy_en_rtc_clock_freq_t</a> clkSel)</td></tr>
<tr class="memdesc:gafd6640533419a469e0803709c2a00aa3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Selects the RTC pre-scaler value and changes its clock frequency.  <a href="#gafd6640533419a469e0803709c2a00aa3">More...</a><br /></td></tr>
<tr class="separator:gafd6640533419a469e0803709c2a00aa3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5e627b3c4c82ee379c04dcb7e754f7d8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__general__functions.html#ga5e627b3c4c82ee379c04dcb7e754f7d8">Cy_RTC_SelectClockSource</a> (<a class="el" href="group__group__rtc__enums.html#ga6620485d475a6116576bd6981e01108e">cy_en_rtc_clk_select_sources_t</a> clkSel)</td></tr>
<tr class="separator:ga5e627b3c4c82ee379c04dcb7e754f7d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf36756aa9b28a64258a08c03135b2e81"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__general__functions.html#gaf36756aa9b28a64258a08c03135b2e81">Cy_RTC_CalibrationControlEnable</a> (uint8_t calib_val, <a class="el" href="group__group__rtc__enums.html#ga27d0d203e4fec44e87b25fdaedb8a534">cy_en_rtc_calib_sign_t</a> calib_sign, <a class="el" href="group__group__rtc__enums.html#ga3401259c29686278c4311b75ebc70f55">cy_en_rtc_calib_sel_t</a> calib_sel)</td></tr>
<tr class="memdesc:gaf36756aa9b28a64258a08c03135b2e81"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function writes calibration control register.  <a href="#gaf36756aa9b28a64258a08c03135b2e81">More...</a><br /></td></tr>
<tr class="separator:gaf36756aa9b28a64258a08c03135b2e81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga45217f2d6714fec65b2711e83c65d2ac"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__rtc__general__functions.html#ga45217f2d6714fec65b2711e83c65d2ac">Cy_RTC_CalibrationControlDisable</a> (void)</td></tr>
<tr class="memdesc:ga45217f2d6714fec65b2711e83c65d2ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function disables the calibration control.  <a href="#ga45217f2d6714fec65b2711e83c65d2ac">More...</a><br /></td></tr>
<tr class="separator:ga45217f2d6714fec65b2711e83c65d2ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga4c6aca12f876f94707818e7a5dcdbf82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4c6aca12f876f94707818e7a5dcdbf82">&#9670;&nbsp;</a></span>Cy_RTC_Init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a> Cy_RTC_Init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__rtc__config__t.html">cy_stc_rtc_config_t</a> const *&#160;</td>
          <td class="paramname"><em>config</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initializes the RTC driver. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">*config</td><td>The pointer to the RTC configuration structure, see <a class="el" href="structcy__stc__rtc__config__t.html">cy_stc_rtc_config_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Checking result. If the pointer is NULL, returns an error. See <a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>. </dd></dl>

</div>
</div>
<a id="ga47268d3ac315e0d41b4795362bc444a8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga47268d3ac315e0d41b4795362bc444a8">&#9670;&nbsp;</a></span>Cy_RTC_SetDateAndTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a> Cy_RTC_SetDateAndTime </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__rtc__config__t.html">cy_stc_rtc_config_t</a> const *&#160;</td>
          <td class="paramname"><em>dateTime</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the time and date values into the RTC_TIME and RTC_DATE registers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dateTime</td><td>The pointer to the RTC configuration structure, see <a class="el" href="structcy__stc__rtc__config__t.html">cy_stc_rtc_config_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A validation check result of date and month. Returns an error, if the date range is invalid. See <a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>The function may return CY_RTC_INVALID_STATE if the RTC is busy with previous update. In such situation, user should call this function repetitively with appropriate parameters to ensure that RTC is updated with provided arguments.</dd>
<dd>
Refresh ALARM using <a class="el" href="group__group__rtc__alarm__functions.html#ga92807dc709c679c70c07d44cf0331a94">Cy_RTC_SetAlarmDateAndTime</a> if it is already enabled before calling this API. </dd></dl>

</div>
</div>
<a id="gace30abad5d40fc768d7c4fc14e84e847"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gace30abad5d40fc768d7c4fc14e84e847">&#9670;&nbsp;</a></span>Cy_RTC_GetDateAndTime()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_RTC_GetDateAndTime </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcy__stc__rtc__config__t.html">cy_stc_rtc_config_t</a> *&#160;</td>
          <td class="paramname"><em>dateTime</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the current RTC time and date. </p>
<p>The AHB RTC Time and Date register values are stored into the *dateTime structure.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">dateTime</td><td>The RTC time and date structure. See <a class="el" href="group__group__rtc__data__structures.html">Data Structures</a>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga2f2ba9ba2a8e6434242134a1c1a55949"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga2f2ba9ba2a8e6434242134a1c1a55949">&#9670;&nbsp;</a></span>Cy_RTC_SetDateAndTimeDirect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a> Cy_RTC_SetDateAndTimeDirect </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>sec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>min</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>hour</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>date</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>month</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>year</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the time and date values into the RTC_TIME and RTC_DATE registers using direct time parameters. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">sec</td><td>The second valid range is [0-59].</td></tr>
    <tr><td class="paramname">min</td><td>The minute valid range is [0-59].</td></tr>
    <tr><td class="paramname">hour</td><td>The hour valid range is [0-23]. This parameter should be presented in the 24-hour format.</td></tr>
  </table>
  </dd>
</dl>
<p>The function reads the current 12/24-hour mode, then converts the hour value properly as the mode.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">date</td><td>The date valid range is [1-31], if the month of February is selected as the Month parameter, then the valid range is [0-29].</td></tr>
    <tr><td class="paramname">month</td><td>The month valid range is [1-12].</td></tr>
    <tr><td class="paramname">year</td><td>The year valid range is [0-99].</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A validation check result of date and month. Returns an error, if the date range is invalid or the RTC time and date set was cancelled: the RTC Write bit was not set, the RTC was synchronizing. See <a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>. </dd></dl>

</div>
</div>
<a id="gaaf46c9f9e3dd7029a6c18a711d45aa86"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaaf46c9f9e3dd7029a6c18a711d45aa86">&#9670;&nbsp;</a></span>Cy_RTC_SetHoursFormat()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a> Cy_RTC_SetHoursFormat </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__rtc__enums.html#ga40c0bfe67e6abf9f8807c8653de6a11b">cy_en_rtc_hours_format_t</a>&#160;</td>
          <td class="paramname"><em>hoursFormat</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Sets the 12/24-hour mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">hoursFormat</td><td>The current hour format, see <a class="el" href="group__group__rtc__enums.html#ga40c0bfe67e6abf9f8807c8653de6a11b">cy_en_rtc_hours_format_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>A validation check result of RTC register update. See <a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a>.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>Refresh ALARM using <a class="el" href="group__group__rtc__alarm__functions.html#ga92807dc709c679c70c07d44cf0331a94">Cy_RTC_SetAlarmDateAndTime</a> if it is already enabled before calling this API. </dd></dl>

</div>
</div>
<a id="gafd6640533419a469e0803709c2a00aa3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gafd6640533419a469e0803709c2a00aa3">&#9670;&nbsp;</a></span>Cy_RTC_SelectFrequencyPrescaler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_RTC_SelectFrequencyPrescaler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__rtc__enums.html#gaa98ef67a70e8f64649634baee4498d56">cy_en_rtc_clock_freq_t</a>&#160;</td>
          <td class="paramname"><em>clkSel</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Selects the RTC pre-scaler value and changes its clock frequency. </p>
<p>If the external 32.768 kHz WCO is absent on the board, the RTC can be driven by a 32.768kHz square clock source or an external 50-Hz or 60-Hz sine-wave clock source, for example the wall AC frequency.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">clkSel</td><td>clock frequency, see <a class="el" href="group__group__rtc__enums.html#gaa98ef67a70e8f64649634baee4498d56">cy_en_rtc_clock_freq_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<p>In addition to generating the 32.768 kHz clock from external crystals, the WCO can be sourced by an external clock source (50 Hz or 60Hz), even the wall AC frequency as a timebase. The API helps select between the RTC sources:</p><ul>
<li>A 32.768 kHz digital clock source.</li>
<li>An external 50-Hz or 60-Hz sine-wave clock source.</li>
</ul>
<p>If you want to use an external 50-Hz or 60-Hz sine-wave clock source to drive the RTC, the next procedure is required:</p><ol type="1">
<li>Disable the WCO <br />
</li>
<li>Bypass the WCO using the <a class="el" href="group__group__sysclk__wco__funcs.html#gaf254b104b1e1020545103779a573da17" title="Sets whether the WCO is bypassed or not. ">Cy_SysClk_WcoBypass()</a> function.</li>
<li>Configure both wco_out and wco_in pins. Note that only one of the wco pins should be driven and the other wco pin should be floating, which depends on the source that drives the RTC (*1).</li>
<li>Call Cy_RTC_SelectFrequencyPrescaler(CY_RTC_FREQ_60_HZ), if you want to drive the WCO, for example, with a 60 Hz source.</li>
<li>Enable the WCO.</li>
</ol>
<p>If you want to use the WCO after using an external 50-Hz or 60-Hz sine-wave clock source:</p><ol type="1">
<li>Disable the WCO.</li>
<li>Switch-off the WCO bypass using the <a class="el" href="group__group__sysclk__wco__funcs.html#gaf254b104b1e1020545103779a573da17" title="Sets whether the WCO is bypassed or not. ">Cy_SysClk_WcoBypass()</a> function.</li>
<li>Drive off the wco pin with an external signal source.</li>
<li>Call Cy_RTC_SelectFrequencyPrescaler(CY_RTC_FREQ_WCO_32768_HZ).</li>
<li>Enable the WCO.</li>
</ol>
<p>(1) - Refer to the device TRM to know how to configure the wco pins properly and which wco pin should be driven/floating.</p>
<dl class="section warning"><dt>Warning</dt><dd>There is a limitation to the external clock source frequencies. Only two frequencies are allowed - 50 Hz or 60 Hz. Note that this limitation is related to the RTC pre-scaling feature presented in this function. This limitation is not related to WCO external clock sources which can drive the WCO in Bypass mode.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This API is available for CAT1B, CAT1C and CAT1D devices. </dd></dl>

</div>
</div>
<a id="ga5e627b3c4c82ee379c04dcb7e754f7d8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5e627b3c4c82ee379c04dcb7e754f7d8">&#9670;&nbsp;</a></span>Cy_RTC_SelectClockSource()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_RTC_SelectClockSource </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__rtc__enums.html#ga6620485d475a6116576bd6981e01108e">cy_en_rtc_clk_select_sources_t</a>&#160;</td>
          <td class="paramname"><em>clkSel</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">clkSel</td><td>Source clock, see <a class="el" href="group__group__rtc__enums.html#ga6620485d475a6116576bd6981e01108e">cy_en_rtc_clk_select_sources_t</a> Selects the source clock for RTC.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>This API is available for CAT1B devices. </dd></dl>

</div>
</div>
<a id="gaf36756aa9b28a64258a08c03135b2e81"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf36756aa9b28a64258a08c03135b2e81">&#9670;&nbsp;</a></span>Cy_RTC_CalibrationControlEnable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a> Cy_RTC_CalibrationControlEnable </td>
          <td>(</td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>calib_val</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__rtc__enums.html#ga27d0d203e4fec44e87b25fdaedb8a534">cy_en_rtc_calib_sign_t</a>&#160;</td>
          <td class="paramname"><em>calib_sign</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__rtc__enums.html#ga3401259c29686278c4311b75ebc70f55">cy_en_rtc_calib_sel_t</a>&#160;</td>
          <td class="paramname"><em>calib_sel</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function writes calibration control register. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">calib_val</td><td>Calibration value for absolute frequency (at a fixed temperature). Each step causes 128 ticks to be added or removed each hour.</td></tr>
    <tr><td class="paramname">calib_sign</td><td>Remove or Add ticks, see <a class="el" href="group__group__rtc__enums.html#ga27d0d203e4fec44e87b25fdaedb8a534">cy_en_rtc_calib_sign_t</a></td></tr>
    <tr><td class="paramname">calib_sel</td><td>Select calibration wave output signal, see <a class="el" href="group__group__rtc__enums.html#ga3401259c29686278c4311b75ebc70f55">cy_en_rtc_calib_sel_t</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The RTC return status, see <a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a> </dd></dl>

</div>
</div>
<a id="ga45217f2d6714fec65b2711e83c65d2ac"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga45217f2d6714fec65b2711e83c65d2ac">&#9670;&nbsp;</a></span>Cy_RTC_CalibrationControlDisable()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a> Cy_RTC_CalibrationControlDisable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function disables the calibration control. </p>
<dl class="section return"><dt>Returns</dt><dd>The RTC return status, see <a class="el" href="group__group__rtc__enums.html#ga45a1b113f07f81bc369d7bf9da75eaae">cy_en_rtc_status_t</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
